Skip to content

fix(docs): restore fenced code block contrast inside callouts - #1212

Merged
bensabic merged 1 commit into
mainfrom
fix/docs-callout-code-block-contrast
Dec 4, 2026
Merged

bensabic merged 1 commit into
mainfrom
fix/docs-callout-code-block-contrast

Conversation

@bensabic

@bensabic bensabic commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the failing docs-a11y CI check introduced after bumping @vercel/geistdocs to 3.1.5 in #1200.

In @vercel/geistdocs@3.1.5, CalloutContainer applies [&_code]:bg-*-300! and [&_code]:text-*-1000! with !important for warn/warning, error, success, and idea callouts (in addition to [&_code]:text-[12px]!). That selector also matches <pre><code> inside fenced code blocks and overrides CodeBlock's non-important [&_code]:bg-transparent. On /adapters/official/github (apps/docs/content/adapters/official/github.mdx), painting --ds-amber-300 behind Shiki tokens in dark mode dropped contrast below WCAG AA and failed docs-a11y on 2 elements.

This PR adds a .geistdocs-callout pre > code override inside @layer utilities in apps/docs/app/styles/geistdocs.css. Because CSS cascade layers invert for !important, placing the higher-specificity selector in @layer utilities overrides Tailwind's [&_code]:*! utilities without affecting inline <code> elements. It restores a transparent background, --ds-gray-1000 text color, and 13px font size for fenced code blocks across all callout variants in both light and dark modes.

Test plan

  • Ran pnpm check (passed, exit code 0).
  • Ran pnpm turbo build --filter=docs (passed, exit code 0; 341 static pages generated).
  • Ran a focused @axe-core/playwright check against /adapters/official/github on a local next start server using Chrome (channel: "chrome"): both light and dark modes reported 0 non-known WCAG 2.2 A/AA violations, backgroundColor: rgba(0, 0, 0, 0) and fontSize: 13px on .geistdocs-callout pre > code, and 12px preserved on inline .geistdocs-callout p > code.
  • CI's docs-a11y job will verify all 218 page checks against Playwright's bundled Chromium.

Checklist

  • All commits are signed and verified
  • All commits are signed off for the DCO (git commit -s)
  • pnpm validate passes (ran pnpm check and pnpm turbo build --filter=docs; full workspace validation left to CI)
  • Changeset added (N/A, docs-only change)
  • Documentation updated (N/A)

After upgrading @vercel/geistdocs to 3.1.5 in #1200, CalloutContainer applies [&_code]:bg-*-300! and [&_code]:text-*-1000! with !important on warn/warning, error, success, and idea callouts. That selector also matches <pre><code> inside fenced code blocks and overrides CodeBlock's non-important [&_code]:bg-transparent, painting a tinted background behind Shiki tokens. In dark mode on /adapters/official/github, this caused docs-a11y to fail with two color-contrast violations.

Add a scoped .geistdocs-callout pre > code rule inside @layer utilities in apps/docs/app/styles/geistdocs.css so higher specificity wins over Tailwind's !important utilities in the same cascade layer. This restores a transparent background, --ds-gray-1000 text color, and 13px font size for fenced code blocks inside callouts while leaving inline <code> untouched.

Signed-off-by: Ben Sabic <bensabic@users.noreply.github.com>
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
chat Ready Ready Preview, v0 Dec 4, 2026 12:26am UTC

@bensabic
bensabic requested a review from a team December 4, 2026 00:25
@bensabic
bensabic merged commit 9425565 into main Dec 4, 2026
26 of 27 checks passed
@bensabic
bensabic deleted the fix/docs-callout-code-block-contrast branch December 4, 2026 00:37

This branch was successfully deployed

1 active deployment
Preview — a7f5fec5 Deployed Dec 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant